#ifndef _D3D_D3DParticleShader_
#define _D3D_D3DParticleShader_

#include <windows.h>
#include <d3dx9.h>

#include "..\..\common\types.h"
#include "..\..\common\arraylist.hpp"

#include "..\interface_types.h"
#include "..\d3d.h"
#include "d3d_shader.h"

#include "..\..\common\string.h"

class CD3D9Device; 

/**************************************
 *Implementation of the shader for the
 *D3D device for point groups
 **************************************/
struct D3DSpriteShader : public D3DShader
{
private:
	friend class CD3D9Device;  

protected:
	D3DSpriteShader(CD3D9Device* const pDevice); 
	virtual ~D3DSpriteShader();
	
	unsigned int RenderOrder();
	HRESULT ConstructInstanceBuffer();
	HRESULT InitalizeParameters(LPD3DXEFFECT pEffect);
	HRESULT UpdateParameters(LPD3DXEFFECT pEffect);
	D3DVERTEXELEMENT9* GetVertexDeclarationElements();
	
public:
	
	virtual void Execute(const int flags = RENDER_DEFAULT); 
	string GetType() const; 
}; 

/**************************************
 *Implementation of the shader for the
 *D3D device for point groups
 **************************************/
struct D3DScreenSpriteShader : public D3DSpriteShader
{
private:
	friend class CD3D9Device; 

protected:
	D3DScreenSpriteShader(CD3D9Device *pDevice); 

	HRESULT InitalizeParameters(LPD3DXEFFECT pEffect);
	HRESULT UpdateParameters(LPD3DXEFFECT pEffect);

public:

	string GetType() const; 
}; 

/**************************************
 *Implementation of the shader for the
 *D3D device for particle systems
 **************************************/
struct D3DParticleShader : public D3DSpriteShader
{
private:
	friend class CD3D9Device; 

	D3DXHANDLE mp_WorldHandle; 
protected:
	D3DParticleShader(CD3D9Device* const pDevice); 

	unsigned int RenderOrder();
	HRESULT InitalizeParameters(LPD3DXEFFECT pEffect);
	HRESULT UpdateParameters(LPD3DXEFFECT pEffect);
	D3DVERTEXELEMENT9* GetVertexDeclarationElements();

public:
	void Execute(const int flags = RENDER_DEFAULT);
	string GetType() const; 
}; 


#endif